<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Document</title>
		<meta name="viewport" content=" width=device-width initial-scale=1.0 maximum-scale=1 minimum-scale=1 user-scalable=no viewport-fit=cover">
		<style>
			*{
				margin: 0;
				padding: 0;
			}
			html,body,.wraper{
				width: 100%;
				height: 100%;
			}
			#baidu{
				width: 100%;
				height: 280px;
				background-color: orange;
				display: block;
			}
			.mask{
				position: absolute;
				text-align: center;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				background-color: rgba(0, 0, 0, 0.5)
			}
			.title{
				color: white;
				margin-top: 100px;
				font-size: 40px;
			}
			.close-btn{
				width: 100px;
				height: 40px;
				font-size: 20px;
			}
		</style>
	</head>
	<body>
		<div class="wraper">
			<div class="mask">
				<h2 class="title">恭喜一等奖！</h2>
				<button class="close-btn">关闭</button>
			</div>
			<div id="baidu">点我去百度</div>
		</div>
		<script type="text/javascript" >
			//获取关闭按钮
			const btn = document.querySelector('.close-btn')
			const baidu = document.getElementById('baidu')
			//绑定监听
			btn.addEventListener('touchend',()=>{
				//让遮罩层消失
				const mask = document.querySelector('.mask')
				mask.style.display = 'none'
			})
			baidu.addEventListener('touchend',()=>{
				window.location.href = 'https://www.baidu.com'
			})

		</script>
	</body>
</html>